﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using RuleCode.Table;

namespace chatblog.bbsmanage
{
    public partial class mybbs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (AliApi.appUserId == "")
            {
                Response.Redirect(ResolveUrl("~/login/login.aspx?redirecturl=") + ResolveUrl("~/bbsmanage/mybbs.aspx"));
            }
            dealrequest();
            Response.Redirect(ResolveUrl("~/bbs.aspx"));
        }
        private void dealrequest()
        {
            cbarea area;
            area = cbarea.Find(" cbuserid = '" + AliApi.appUserId + "'"
                );
            if (area.Count < 1)
            {
                MessageBox.Show(this.Page, "请先创建站点.");
                Response.Redirect(ResolveUrl("~/bbsmanage/newsiteapp.aspx"));
            }
            else
            {
                cbuser u = cbuser.Find(" cbuserid = '" + AliApi.appUserId + "'"
                );
                Response.Redirect("http://" + u.RECID.ToString() + ".bbs.f980.com/");
            }

        }
    }
}
